1. Technical Field
The present invention relates to data processing and, in particular, to class loaders in a Java virtual machine. Still more particularly, the present invention provides a method, apparatus, and program for loading plug-in classes at an appropriate location in the class loader hierarchy.
2. Description of Related Art
Many applications allow functionality to be extended through plug-ins. For example, a Web server application may be extended with an encryption plug-in. Plug-ins are application extensions that are registered to the application through a registry or configuration file. It is the job of the application to load the appropriate plug-ins and invoke them at the appropriate times during the application life cycle.
In environments where a class loader is used to load a class (i.e. Java), the application must determine which class loader to use to initiate the loading of the plug-in classes. If the application uses the class loader that loaded the application classes to initiate the loading of the plug-in classes, this can pose several problems. To use the application's class loader structure to load plug-in classes may require the class path to be modified such that the application class loader can load the plug-in classes. This may be difficult to accomplish due to various factors, such as security, customized class loaders, and remote location of classes.
Furthermore, the manner in which the class path can be modified varies from application to application, and even within the application depending on the class loader that is used. There is no generic manner in which any or all class loaders can be configured to load the plug-in classes. Yet another problem can be encountered if the class loader delegation model is properly followed by the application's class loaders and multiple different class loaders are used to load application classes.
Therefore, it would be advantageous to provide an improved mechanism for loading plug-in classes at an appropriate location in the class loader hierarchy.